<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<script>
function setMaster(type){
	var array = {};
	
	var userid = sns.getCheckbox("ck_users");
	if(userid == false){
		alert('please choose at least one');
		return;
	}
	if(userid.indexOf(",") != -1){
		alert('Only can choose one');
		return;
	}

	var url = "<c:url value='/admin/bbs/masterSet.do?boardId=" + $("#boardId").val() + "&setid="+userid + "&level=" + type + "' />";
	
	window.location.href = url;
}
</script>
<div class="descr">
	当前为 版区：<c:out value="${board.chineseName}" />设置版主
	<br/>
	超级版主：对所有版块都具有管理权限。  高级版主：对某个主版块下的所有子版块具有管理权限。
	普通版主：对某个子版块具有管理权限
</div>
<div class="bu">
	<button onclick="setMaster(1)" class="btn3_mouseout" onmouseover="this.className='btn3_mouseover'"
	onmouseout="this.className='btn3_mouseout'" onmousedown="this.className='btn3_mousedown'"
	onmouseup="this.className='btn3_mouseup'" title="Create"><fmt:message key="html.admin.master.set1"/></button>&nbsp;&nbsp;
	<button onclick="setMaster(2)" class="btn3_mouseout" onmouseover="this.className='btn3_mouseover'"
	onmouseout="this.className='btn3_mouseout'" onmousedown="this.className='btn3_mousedown'"
	onmouseup="this.className='btn3_mouseup'"title="delete"><fmt:message key="html.admin.master.set2"/></button>&nbsp;&nbsp;
	<button onclick="setMaster(3)" class="btn3_mouseout" onmouseover="this.className='btn3_mouseover'"
	onmouseout="this.className='btn3_mouseout'" onmousedown="this.className='btn3_mousedown'"
	onmouseup="this.className='btn3_mouseup'"title="view"><fmt:message key="html.admin.master.set3"/></button>&nbsp;&nbsp;
</div>
<div>
	<form id="f_search_user" action="masterSearch.do" method="post">
		<input type="hidden" id="page_pageIndex" name="page.pageIndex" value='<c:out value="${page.pageIndex }"/>'/>
		<input type="hidden" id="page_pageSize" name="page.pageSize" value='<c:out value="${page.pageSize }"/>'/>
		<input type="hidden" id="boardId" name="boardId" value='<c:out value="${boardId}"/>'/>
		<select name="searchType">
			<option value="1">用户名</option>
			<option value="2">用户昵称</option>
		</select>
		<input type="text" name="searchValue"/>
		<input type="submit" name="Submit" value="Submit" />
	</form>
</div>
<div>
<table id="t_user_list" width="100%"  border="0" cellpadding="0" cellspacing="0" class="pub_list01">
	<thead>
		<tr>
			<th width="50px" class="tdCenter">
			</th>
			<th width="75px" class="tdCenter">用户昵称</th>
		</tr>
	</thead>
	<tbody>
		<c:choose>
			<c:when test="${1 > 0 }">
				<c:forEach var="user" items="${page.items}" varStatus="status">
				<tr>
					<td class="tdCenter">
						<input type="checkbox" name="ck_users" id="ck_<c:out value='${user.userid}' />" value="${user.userid}"></input>
					</td>
					<td class="tdCenter">
						<c:out value="${user.nickname}"></c:out>
					</td>
				</tr>
				</c:forEach>
			</c:when>
			<c:otherwise>
			<tr>
				<td>
				没有记录
				</td>
			</tr>
			</c:otherwise>
		</c:choose>
	</tbody>
</table>
<jsp:include page="/common/pager.jsp" />
</div>
<br/>
<div class="bu">
	<button onclick="setMaster(1)" class="btn3_mouseout" onmouseover="this.className='btn3_mouseover'"
	onmouseout="this.className='btn3_mouseout'" onmousedown="this.className='btn3_mousedown'"
	onmouseup="this.className='btn3_mouseup'" title="Create"><fmt:message key="html.admin.master.set1"/></button>&nbsp;&nbsp;
	<button onclick="setMaster(2)" class="btn3_mouseout" onmouseover="this.className='btn3_mouseover'"
	onmouseout="this.className='btn3_mouseout'" onmousedown="this.className='btn3_mousedown'"
	onmouseup="this.className='btn3_mouseup'"title="delete"><fmt:message key="html.admin.master.set2"/></button>&nbsp;&nbsp;
	<button onclick="setMaster(3)" class="btn3_mouseout" onmouseover="this.className='btn3_mouseover'"
	onmouseout="this.className='btn3_mouseout'" onmousedown="this.className='btn3_mousedown'"
	onmouseup="this.className='btn3_mouseup'"title="view"><fmt:message key="html.admin.master.set3"/></button>&nbsp;&nbsp;
</div>